#include <iostream>
#include <cmath>
using namespace std;
int main()
{
    int n,m;
    while (cin>>n>>m)
    {
        if (n==0&&m==0)break;
        int mm=(int)sqrt(m*2.0);
        int i;
        for (i=mm;i>0;i--)
        {
            int k=m-i*(i-1)/2;
            if (k>0)
            {
                if (k%i==0)
                {
                    k/=i;
                    cout<<"["<<k<<","<<k+i-1<<"]"<<endl;
                }
            }
        }
        cout<<endl;
    }
    return 0;
}